<template>
  <div>
    <el-form-item :label="imgTips">
      <el-upload
        ref="upload"
        class="upload-demo"
        drag
        :on-remove="handleRemove"
        :on-success="handleSuccess"
        :on-error="handleError"
        action="http://up-z2.qiniu.com"
        :data="upToken"
        :file-list="form.fileList"
        :limit="1"
      >
        <img v-if="img" :src="'http://' + img" class="avatar">
        <i class="el-icon-upload"></i>
        <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
        <div class="el-upload__tip" slot="tip">只能上传jpg/png文件，且不超过500kb</div>
      </el-upload>
    </el-form-item>
  </div>
</template>
<script>
import bus from '../../bus.js'
import imageUpload from '../JS/imageUpload.js';
export default imageUpload;
</script>
<style scoped>
.avatar{
    float: left;
    width: 100%;
    height: 100%;
}
</style>
